package com.longge;

import java.util.stream.IntStream;

public class FindMaximumXOR {

    public int findMaximumXOR(int[] nums) {

        int max = 0;
        nums = IntStream.of(nums).distinct().toArray();
        for (int i = 0; i < nums.length; i++) {
            for (int j = i; j < nums.length; j++) {
                max = Math.max(i ^ j, max);
            }
        }
        return max;
    }

}
